package org.example.model.enums;

/**
 * @author wuyong
 * @date 2025/6/13
 */
public enum ModuleEnum {

    /** 工单 */
    WORKORDER("workorder", "工单"),
    ROUTING("routing", "巡检"),
    LABORATORY("laboratory", "化验"),
    WORK_FLOW("work_flow", "工单流程"),
    SCHEDULING("scheduling", "排班"),
    /** 系统 */
    SYSTEM("system", "系统用户角色公告消息字典"),
    MDM("mdm", "主数据组织运营项目合同客户供应商"),
    EQUIP("equip", "设备设施"),
    FACTORY("factory", "水厂信息"),
    /** 经营 */
    OPERATION("operation", "经营"),
    ELECTRICITY("electricity", "电费"),
    SLUDGE("sludge", "污泥"),
    WATER("water", "水费"),
    /** 报警 */
    ALARM("alarm", "报警"),
    SIGNAL("signal", "自控信号"),
    CHECK("check", "盘点"),
    MALL("mall", "商城"),
    WAREHOUSE("warehouse", "库存"),
    parts("parts", "备品配件"),
    // 基本面
    INDICATOR("indicator", "基本面"),
    DATA_CENTER("DataCenter", "数据中台"),
    STRATEGY("strategy", "一厂一策"),
    DRAFT("draft", "底稿"),
    STAR("star", "星级评价"),
    OTHER("other", "其他溢流危险作业预算已知未分类");

    private final String code;
    private final String desc;

    ModuleEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
    public static ModuleEnum getByCode(String code) {
        for (ModuleEnum value : values()) {
            if (value.code.equals(code)) {
                return value;
            }
        }
        return null;
    }
}
